<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>编辑图鉴</title>
</head>
<body>
<script type="text/html" id="form">
    <input type="hidden" name="id" value="{{ d.id }}"/>
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">

                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <text title="必填项" style="color:red;">*</text>
                        图鉴名称</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" lay-verify="required" value="{{d.name}}" autocomplete="off"
                               placeholder="请输入图鉴名称" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <text style="color:red;">*</text>
                        分类</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="category"
                             data-sourceType="data"
                             data-radio="true"
                             data-source="[{name:'方块',value:'方块'},{name:'食物',value:'食物'},{name:'工具',value:'工具'},{name:'魔咒',value:'魔咒'},{name:'状态',value:'状态'},{name:'生物',value:'生物'}]"
                             data-selected="{{=d.category}}"
                             data-layVerify="required"
                             data-onchange="changeType2"
                        ></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <text style="color:red;">*</text>
                        二级分类</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="sub_category"
                             data-sourceType="data"
                             data-radio="true"
                             data-layVerify="required"
                             data-source="[{name:'建筑方块',value:'建筑方块'},{name:'装饰性方块',value:'装饰性方块'},{name:'红石',value:'红石'},{name:'食物',value:'食物'},{name:'工具',value:'工具'},{name:'战斗用品',value:'战斗用品'},{name:'一级',value:'一级'},{name:'二级',value:'二级'},{name:'三级',value:'三级'},{name:'四级',value:'四级'},{name:'五级',value:'五级'},{name:'减益',value:'减益'},{name:'增益',value:'增益'},{name:'特殊',value:'特殊'},{name:'友好生物',value:'友好生物'},{name:'敌对生物',value:'敌对生物'}]"
                             data-selected="{{=d.sub_category}}"
                        ></div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">图示</label>
                    <div class="layui-input-block">
                        <div class="laytpUpload"
                             data-name="img"
                             data-accept="image"
                             data-type="ali-oss"
                             data-layVerify="required"
                             data-uploaded="{{ d.img }}"
                             data-uploadedId="{{ d.img }}"
                             data-showChoiceBtn="false"
                        ></div>
                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">大图</label>
                    <div class="layui-input-block">
                        <div class="laytpUpload"
                             data-name="big_img"
                             data-accept="image"
                             data-type="ali-oss"
                             data-width="1000"
                             data-height="1400"
                             data-uploaded="{{ d.big_img }}"
                             data-uploadedId="{{ d.big_img }}"
                             data-showChoiceBtn="false"
                        ></div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">
                        <text title="必填项" style="color:red;">*</text>
                        描述</label>
                    <div class="layui-input-block">
                        <input type="text" name="description" lay-verify="required" value="{{d.description}}"
                               autocomplete="off" placeholder="请输入描述" class="layui-input">
                    </div>
                </div>

                <blockquote class="layui-elem-quote">基础属性</blockquote>
                <div class="layui-form-item Fangkuai" id="type1">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">亮度</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type1_light" value="{{ d.type1_light}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input fangkuai-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">爆炸</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type1_blast" value="{{ d.type1_blast}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input fangkuai-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">是否恢复</label>
                        <div class="layui-input-inline">
                            <input type="text" name="revive" value="{{ d.revive}}" autocomplete="off"
                                   placeholder="请输入是或否" class="layui-input fangkuai-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">堆</label>
                        <div class="layui-input-inline">
                            <input type="text" name="stack" value="{{ d.stack}}" autocomplete="off"
                                   placeholder="请输入是(64)或否(64)" class="layui-input fangkuai-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">硬度</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type1_hardness" value="{{ d.type1_hardness}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input fangkuai-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">是否交易</label>
                        <div class="layui-input-inline">
                            <input type="text" name="is_deal" value="{{ d.is_deal}}" autocomplete="off"
                                   placeholder="请输入是或否" class="layui-input fangkuai-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item" id="type2" style="display: none">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">饥饿值</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type2_back" value="{{ d.type2_back}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input shiwu-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">是否恢复</label>
                        <div class="layui-input-inline">
                            <input type="text" name="revive" value="{{ d.revive}}" autocomplete="off"
                                   placeholder="请输入是或否" class="layui-input shiwu-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">堆</label>
                        <div class="layui-input-inline">
                            <input type="text" name="stack" value="{{ d.stack}}" autocomplete="off"
                                   placeholder="请输入是(64)或否(64)" class="layui-input shiwu-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item Gongju" id="type3" style="display: none">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">耐久</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type3_durable" value="{{ d.type3_durable}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input gongju-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">是否恢复</label>
                        <div class="layui-input-inline">
                            <input type="text" name="revive" value="{{ d.revive}}" autocomplete="off"
                                   placeholder="请输入是或否" class="layui-input gongju-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">堆</label>
                        <div class="layui-input-inline">
                            <input type="text" name="stack" value="{{ d.stack}}" autocomplete="off"
                                   placeholder="请输入是(64)或否(64)" class="layui-input gongju-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item Mozhou" id="type4" style="display: none">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">最大等级</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type4_maxLevel" value="{{ d.type4_maxLevel}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input mozhou-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">id</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type4_id" value="{{ d.type4_id}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input mozhou-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">重量</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type4_weight" value="{{ d.type4_weight}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input mozhou-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item Zhuangtai" id="type5" style="display: none">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">类别</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type5_category" value="{{ d.type5_category}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input zhuangtai-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">标签</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type5_type" value="{{ d.type5_type}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input zhuangtai-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">颜色</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type5_point" value="{{ d.type5_point}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input zhuangtai-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">等级</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type5_level" value="{{ d.type5_level}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input zhuangtai-input">
                        </div>
                    </div>
                </div>
                <div class="layui-form-item Shengwu" id="type6" style="display: none">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">生命</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type6_life" value="{{ d.type6_life}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input shengwu-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">防御</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type6_defense" value="{{ d.type6_defense}}" autocomplete="off"
                                   placeholder="请输入数值" class="layui-input shengwu-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">经验</label>
                        <div class="layui-input-inline">
                            <input type="text" name="type6_experience" value="{{ d.type6_experience}}"
                                   autocomplete="off" placeholder="请输入数值" class="layui-input shengwu-input">
                        </div>
                    </div>
                </div>

                <div class="layui-form-item" id="type13" style="display: none">
                    <blockquote class="layui-elem-quote">开采工具</blockquote>
                    <label class="layui-form-label">开采工具</label>
                    <div class="layui-inline">
                        <div class="layui-input-block" style="width: 500px;">
                            <div class="xmSelect"
                                 data-name="tool_name"
                                 data-sourceType="route"
                                 data-source="/admin.myworld.good/worldImg"
                                 data-radio="true"
                                 data-textField="name"
                                 data-valueField="name"
                                 data-selected="{{=d.tool_name}}"
                                 data-onchange="changeType2"
                            ></div>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item" id="type14" style="display: none">
                    <blockquote class="layui-elem-quote">用途</blockquote>
                    <table class="layui-table" style="margin: 0;" lay-skin="line">
                        <colgroup>
                            <col width="20%">
                            <col width="80%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>标题</th>
                            <th>描述</th>
                        </tr>
                        </thead>
                        <tbody class="tableDnd">
                        {{# if(d.use){ }}
                        {{# var key; for(key in d.use){ }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="use_title[]"
                                                                  value="{{=d.use[key]['title']}}"/></td>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="use_content[]"
                                                                  value="{{=d.use[key]['content']}}"/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        {{# } }}
                        {{# } }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="use_title[]"
                                                                  value=""/></td>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="use_content[]"
                                                                  value=""/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        <tr class='nodrop nodrag'>
                            <td colspan="4" style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-add-1 addArrayItem"
                                   title="追加">追加</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <div class="layui-form-item" id="type15" style="display: none">
                    <blockquote class="layui-elem-quote">获取方式</blockquote>
                    <table class="layui-table" style="margin: 0;" lay-skin="line">
                        <colgroup>
                            <col width="20%">
                            <col width="80%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>标题</th>
                            <th>描述</th>
                        </tr>
                        </thead>
                        <tbody class="tableDnd">
                        {{# if(d.get_way){ }}
                        {{# var key; for(key in d.get_way){ }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="get_way_title[]"
                                                                  value="{{=d.get_way[key]['title']}}"/></td>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text"
                                                                  name="get_way_content1[]"
                                                                  value="{{=d.get_way[key]['content']}}"/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        {{# } }}
                        {{# } }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="get_way_title[]"
                                                                  value=""/></td>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text"
                                                                  name="get_way_content1[]" value=""/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        <tr class='nodrop nodrag'>
                            <td colspan="4" style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-add-1 addArrayItem"
                                   title="追加">追加</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="layui-form-item" id="type16" style="display: none">
                    <blockquote class="layui-elem-quote">获取方式</blockquote>
                    <table class="layui-table" style="margin: 0;" lay-skin="line">
                        <colgroup>
                            <col width="90%">
                            <col width="10%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>标题</th>
                            <th></th>
                        </tr>
                        </thead>
                        <tbody class="tableDnd">
                        {{# if(d.get_way){ }}
                        {{# var key; for(key in d.get_way){ }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="get_way_content2[]"
                                                                  value="{{=d.get_way[key]}}"/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        {{# } }}
                        {{# } }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="get_way_content2[]"
                                                                  value=""/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        <tr class='nodrop nodrag'>
                            <td colspan="4" style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-add-1 addArrayItem"
                                   title="追加">追加</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <blockquote class="layui-elem-quote">关联物品</blockquote>
                <div class="layui-form-item">
                    <label class="layui-form-label">关联物品</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="make_goods"
                             data-sourceType="route"
                             data-source="/admin.myworld.good/worldImg"
                             data-radio="false"
                             data-textField="name"
                             data-valueField="name"
                             data-selected="{{=d.make_goods}}"
                        ></div>
                    </div>
                </div>
                <blockquote class="layui-elem-quote">相容物品</blockquote>
                <div class="layui-form-item">
                    <label class="layui-form-label">相容物品</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="fuse_goods"
                             data-sourceType="route"
                             data-source="/admin.myworld.good/worldImg"
                             data-radio="false"
                             data-textField="name"
                             data-valueField="name"
                             data-selected="{{=d.fuse_goods}}"
                        ></div>
                    </div>
                </div>
                <blockquote class="layui-elem-quote">合成方式</blockquote>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">材料1</label>
                        <td style="padding: 4px 15px;">
                            <div class="layui-input-block" style="width: 200px;">
                                <div class="xmSelect"
                                     data-name="formula_position1"
                                     data-sourceType="route"
                                     data-source="/admin.myworld.good/worldImg"
                                     data-radio="true"
                                     data-textField="name"
                                     data-valueField="name"
                                     data-selected="{{=d.formula_position1}}"
                                ></div>
                            </div>
                        </td>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">材料2</label>
                        <td style="padding: 4px 15px;">
                            <div class="layui-input-block" style="width: 200px;">
                                <div class="xmSelect"
                                     data-name="formula_position2"
                                     data-sourceType="route"
                                     data-source="/admin.myworld.good/worldImg"
                                     data-radio="true"
                                     data-textField="name"
                                     data-valueField="name"
                                     data-selected="{{=d.formula_position2}}"
                                ></div>
                            </div>
                        </td>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">材料3</label>
                        <td style="padding: 4px 15px;">
                            <div class="layui-input-block" style="width: 200px;">
                                <div class="xmSelect"
                                     data-name="formula_position3"
                                     data-sourceType="route"
                                     data-source="/admin.myworld.good/worldImg"
                                     data-radio="true"
                                     data-textField="name"
                                     data-valueField="name"
                                     data-selected="{{=d.formula_position3}}"
                                ></div>
                            </div>
                        </td>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">材料4</label>
                        <td style="padding: 4px 15px;">
                            <div class="layui-input-block" style="width: 200px;">
                                <div class="xmSelect"
                                     data-name="formula_position4"
                                     data-sourceType="route"
                                     data-source="/admin.myworld.good/worldImg"
                                     data-radio="true"
                                     data-textField="name"
                                     data-valueField="name"
                                     data-selected="{{=d.formula_position4}}"
                                ></div>
                            </div>
                        </td>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">材料5</label>
                        <td style="padding: 4px 15px;">
                            <div class="layui-input-block" style="width: 200px;">
                                <div class="xmSelect"
                                     data-name="formula_position5"
                                     data-sourceType="route"
                                     data-source="/admin.myworld.good/worldImg"
                                     data-radio="true"
                                     data-textField="name"
                                     data-valueField="name"
                                     data-selected="{{=d.formula_position5}}"
                                ></div>
                            </div>
                        </td>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">材料6</label>
                        <td style="padding: 4px 15px;">
                            <div class="layui-input-block" style="width: 200px;">
                                <div class="xmSelect"
                                     data-name="formula_position6"
                                     data-sourceType="route"
                                     data-source="/admin.myworld.good/worldImg"
                                     data-radio="true"
                                     data-textField="name"
                                     data-valueField="name"
                                     data-selected="{{=d.formula_position6}}"
                                ></div>
                            </div>
                        </td>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">材料7</label>
                        <td style="padding: 4px 15px;">
                            <div class="layui-input-block" style="width: 200px;">
                                <div class="xmSelect"
                                     data-name="formula_position7"
                                     data-sourceType="route"
                                     data-source="/admin.myworld.good/worldImg"
                                     data-radio="true"
                                     data-textField="name"
                                     data-valueField="name"
                                     data-selected="{{=d.formula_position7}}"
                                ></div>
                            </div>
                        </td>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">材料8</label>
                        <td style="padding: 4px 15px;">
                            <div class="layui-input-block" style="width: 200px;">
                                <div class="xmSelect"
                                     data-name="formula_position8"
                                     data-sourceType="route"
                                     data-source="/admin.myworld.good/worldImg"
                                     data-radio="true"
                                     data-textField="name"
                                     data-valueField="name"
                                     data-selected="{{=d.formula_position8}}"
                                ></div>
                            </div>
                        </td>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label two-part-label">材料9</label>
                        <td style="padding: 4px 15px;">
                            <div class="layui-input-block" style="width: 200px;">
                                <div class="xmSelect"
                                     data-name="formula_position9"
                                     data-sourceType="route"
                                     data-source="/admin.myworld.good/worldImg"
                                     data-radio="true"
                                     data-textField="name"
                                     data-valueField="name"
                                     data-selected="{{=d.formula_position9}}"
                                ></div>
                            </div>
                        </td>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">合成方式</label>
                    <div class="layui-input-block">
                        <input type="text" name="formula_type" value="{{d.formula_type}}" autocomplete="off"
                               placeholder="请输入合成方式" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">数量</label>
                    <div class="layui-input-block">
                        <input type="text" name="formula_num" value="{{d.formula_num}}" autocomplete="off"
                               placeholder="请输入数量" class="layui-input">
                    </div>
                </div>


                <div class="layui-form-item" id="type7" style="display: none">
                    <blockquote class="layui-elem-quote">效果</blockquote>
                    <label class="layui-form-label">效果</label>
                    <div class="layui-input-block">
                        <input type="text" name="effect" value="{{d.effect}}" autocomplete="off"
                               placeholder="请输入效果" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item" id="type8" style="display: none">
                    <table class="layui-table" style="margin: 0;" lay-skin="line">
                        <colgroup>
                            <col width="20%">
                            <col width="80%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>标题</th>
                            <th>描述</th>
                        </tr>
                        </thead>
                        <tbody class="tableDnd">
                        {{# if(d.effect){ }}
                        {{# var key; for(key in d.effect){ }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="effect_title[]"
                                                                  value="{{=d.effect[key]['title']}}"/></td>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text"
                                                                  name="effect_content[]"
                                                                  value="{{=d.effect[key]['content']}}"/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        {{# } }}
                        {{# } }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="effect_title[]"
                                                                  value=""/></td>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text"
                                                                  name="effect_content[]" value=""/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        <tr class='nodrop nodrag'>
                            <td colspan="4" style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-add-1 addArrayItem"
                                   title="追加">追加</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <div class="layui-form-item" id="type9" style="display: none">
                    <blockquote class="layui-elem-quote">大小</blockquote>
                    <table class="layui-table" style="margin: 0;" lay-skin="line">
                        <colgroup>
                            <col width="20%">
                            <col width="80%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>标题</th>
                            <th>描述</th>
                        </tr>
                        </thead>
                        <tbody class="tableDnd">
                        {{# if(d.size){ }}
                        {{# var key; for(key in d.size){ }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="size_title[]"
                                                                  value="{{=d.size[key]['title']}}"/></td>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text"
                                                                  name="get_way_content[]"
                                                                  value="{{=d.size[key]['content']}}"/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        {{# } }}
                        {{# } }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="size_title[]"
                                                                  value=""/></td>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text"
                                                                  name="size_content[]" value=""/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        <tr class='nodrop nodrag'>
                            <td colspan="4" style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-add-1 addArrayItem"
                                   title="追加">追加</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <div class="layui-form-item" id="type10" style="display: none">
                    <blockquote class="layui-elem-quote">装备</blockquote>
                    <label class="layui-form-label">装备</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="equipment"
                             data-sourceType="route"
                             data-source="/admin.myworld.good/worldImg"
                             data-radio="false"
                             data-textField="name"
                             data-valueField="name"
                             data-selected="{{=d.equipment}}"
                        ></div>
                    </div>
                </div>

                <div class="layui-form-item" id="type11" style="display: none">
                    <blockquote class="layui-elem-quote">行为</blockquote>
                    <table class="layui-table" style="margin: 0;" lay-skin="line">
                        <colgroup>
                            <col width="20%">
                            <col width="80%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>标题</th>
                            <th>描述</th>
                        </tr>
                        </thead>
                        <tbody class="tableDnd">
                        {{# if(d.behavior){ }}
                        {{# var key; for(key in d.behavior){ }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="behavior_title[]"
                                                                  value="{{=d.behavior[key]['title']}}"/></td>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text"
                                                                  name="behavior_content[]"
                                                                  value="{{=d.behavior[key]['content']}}"/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        {{# } }}
                        {{# } }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="behavior_title[]"
                                                                  value=""/></td>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text"
                                                                  name="behavior_content[]" value=""/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        <tr class='nodrop nodrag'>
                            <td colspan="4" style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-add-1 addArrayItem"
                                   title="追加">追加</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>

                <div class="layui-form-item" id="type12" style="display: none">
                    <blockquote class="layui-elem-quote">掉落</blockquote>
                    <table class="layui-table" style="margin: 0;" lay-skin="line">
                        <colgroup>
                            <col width="90%">
                            <col width="10%">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>描述</th>
                            <th></th>
                        </tr>
                        </thead>
                        <tbody class="tableDnd">
                        {{# if(d.drop){ }}
                        {{# var key; for(key in d.drop){ }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="drop[]"
                                                                  value="{{=d.drop[key]}}"/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        {{# } }}
                        {{# } }}
                        <tr>
                            <td style="padding: 4px 15px;"><input class="layui-input" type="text" name="drop[]"
                                                                  value=""/></td>
                            <td style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-delete delArrayItem"
                                   layer-tips="删除" title="删除"></a>
                            </td>
                        </tr>
                        <tr class='nodrop nodrag'>
                            <td colspan="4" style="padding: 4px 15px;">
                                <a href="javascript:void(0);"
                                   class="layui-btn layui-btn-primary layui-btn-sm layui-icon layui-icon-add-1 addArrayItem"
                                   title="追加">追加</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>



            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="laytp-btn laytp-btn-primary laytp-btn-sm" lay-submit=""
                    lay-filter="laytp-form">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="laytp-btn laytp-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</script>
<form class="layui-form" lay-filter="layui-form"></form>
<script>
    if (localStorage.getItem("staticDomain")) {
        document.write("<link rel='stylesheet' href='" + localStorage.getItem("staticDomain") + "/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/layui/layui.js?v=" + localStorage.getItem("version") + "'><\/script>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/laytp/layuiConfig.js?v=" + localStorage.getItem("version") + "'><\/script>");
    } else {
        document.write("<link rel='stylesheet' href='/static/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
        document.write("<script src='/static/component/layui/layui.js?v=" + localStorage.getItem("version") + "'><\/script>");
        document.write("<script src='/static/component/laytp/layuiConfig.js?v=" + localStorage.getItem("version") + "'><\/script>");
    }
</script>
<script>
    layui.use(['laytp'], function () {
        let form = layui.form;
        let $ = layui.jquery;
        //获取参数ID
        var id = facade.getUrlParam('id');
        if (!id) {
            facade.error('参数ID不能为空');
            return false;
        }

        //获取数据，渲染到对应的节点上
        facade.ajax({
            route: "/admin.myworld.good/info",
            data: {id: id},
            successAlert: false,
            showLoading: true
        }).done(function (res) {
            if (res.code === 0) {
                layui.laytpl($("#form").html()).render(res.data, function (string) {
                    $("form").html(string);
                    layui.laytpForm.render();
                    form.render();
                    if (res.data.category == '方块') {
                        $('#type1').css('display', 'block');
                        $('#type2').css('display', 'none');
                        $('#type3').css('display', 'none');
                        $('#type4').css('display', 'none');
                        $('#type5').css('display', 'none');
                        $('#type6').css('display', 'none');
                        $('#type7').css('display', 'none');
                        $('#type8').css('display', 'none');
                        $('#type9').css('display', 'none');
                        $('#type10').css('display', 'none');
                        $('#type11').css('display', 'none');
                        $('#type12').css('display', 'none');
                        $('#type13').css('display', 'block');
                        $('#type14').css('display', 'block');
                        $('#type15').css('display', 'block');
                        $('#type16').css('display', 'none');
                    }
                    if (res.data.category == '食物') {
                        $('#type1').css('display', 'none');
                        $('#type2').css('display', 'block');
                        $('#type3').css('display', 'none');
                        $('#type4').css('display', 'none');
                        $('#type5').css('display', 'none');
                        $('#type6').css('display', 'none');
                        $('#type7').css('display', 'none');
                        $('#type8').css('display', 'none');
                        $('#type9').css('display', 'none');
                        $('#type10').css('display', 'none');
                        $('#type11').css('display', 'none');
                        $('#type12').css('display', 'none');
                        $('#type13').css('display', 'none');
                        $('#type14').css('display', 'block');
                        $('#type15').css('display', 'block');
                        $('#type16').css('display', 'none');

                    }
                    if (res.data.category == '工具') {
                        $('#type1').css('display', 'none');
                        $('#type2').css('display', 'none');
                        $('#type3').css('display', 'block');
                        $('#type4').css('display', 'none');
                        $('#type5').css('display', 'none');
                        $('#type6').css('display', 'none');
                        $('#type7').css('display', 'none');
                        $('#type8').css('display', 'none');
                        $('#type9').css('display', 'none');
                        $('#type10').css('display', 'none');
                        $('#type11').css('display', 'none');
                        $('#type12').css('display', 'none');
                        $('#type13').css('display', 'none');
                        $('#type14').css('display', 'block');
                        $('#type15').css('display', 'block');
                        $('#type16').css('display', 'none');

                    }
                    if (res.data.category == '魔咒') {
                        $('#type1').css('display', 'none');
                        $('#type2').css('display', 'none');
                        $('#type3').css('display', 'none');
                        $('#type4').css('display', 'block');
                        $('#type5').css('display', 'none');
                        $('#type6').css('display', 'none');
                        $('#type7').css('display', 'block');
                        $('#type8').css('display', 'none');
                        $('#type9').css('display', 'none');
                        $('#type10').css('display', 'none');
                        $('#type11').css('display', 'none');
                        $('#type12').css('display', 'none');
                        $('#type13').css('display', 'none');
                        $('#type14').css('display', 'none');
                        $('#type15').css('display', 'none');
                        $('#type16').css('display', 'none');

                    }
                    if (res.data.category == '状态') {
                        $('#type1').css('display', 'none');
                        $('#type2').css('display', 'none');
                        $('#type3').css('display', 'none');
                        $('#type4').css('display', 'none');
                        $('#type5').css('display', 'block');
                        $('#type6').css('display', 'none');
                        $('#type7').css('display', 'block');
                        $('#type8').css('display', 'none');
                        $('#type9').css('display', 'none');
                        $('#type10').css('display', 'none');
                        $('#type11').css('display', 'none');
                        $('#type12').css('display', 'none');
                        $('#type13').css('display', 'none');
                        $('#type14').css('display', 'none');
                        $('#type15').css('display', 'none');
                        $('#type16').css('display', 'block');

                    }
                    if (res.data.category == '生物') {
                        $('#type1').css('display', 'none');
                        $('#type2').css('display', 'none');
                        $('#type3').css('display', 'none');
                        $('#type4').css('display', 'none');
                        $('#type5').css('display', 'none');
                        $('#type6').css('display', 'block');
                        $('#type7').css('display', 'none');
                        $('#type8').css('display', 'block');
                        $('#type9').css('display', 'block');
                        $('#type10').css('display', 'block');
                        $('#type11').css('display', 'block');
                        $('#type12').css('display', 'block');
                        $('#type13').css('display', 'none');
                        $('#type14').css('display', 'none');
                        $('#type15').css('display', 'block');
                        $('#type16').css('display', 'none');

                    }
                });
            }
        });

        form.on('submit(laytp-form)', function (data) {
            var btnAnim = layui.button.load({elem: $(this)});
            facade.ajax({
                route: '/admin.myworld.good/edit',
                data: data.field
            }).done(function (res) {
                if (res.code === 0) {
                    parent.layui.layer.close(parent.layui.layer.getFrameIndex(window.name));//关闭当前页
                    parent.layui.table.reload("laytp-table");
                }
                btnAnim.stop();
            }).fail(function () {
                btnAnim.stop();
            });
            return false;
        });
    })
</script>
<script>
    window.changeType2 = function (params) {
        if (params.change[0]['value'] == '方块') {
            $('#type1 .fangkuai-input').attr('lay-verify','required');
            $('#type2 .shiwu-input').removeAttr('lay-verify');
            $('#type3 .gongju-input').removeAttr('lay-verify');
            $('#type4 .mozhou-input').removeAttr('lay-verify');
            $('#type5 .zhuangtai-input').removeAttr('lay-verify');
            $('#type6 .shengwu-input').removeAttr('lay-verify');
            $('#type1').css('display', 'block');
            $('#type2').css('display', 'none');
            $('#type3').css('display', 'none');
            $('#type4').css('display', 'none');
            $('#type5').css('display', 'none');
            $('#type6').css('display', 'none');
            $('#type7').css('display', 'none');
            $('#type8').css('display', 'none');
            $('#type9').css('display', 'none');
            $('#type10').css('display', 'none');
            $('#type11').css('display', 'none');
            $('#type12').css('display', 'none');
            $('#type13').css('display', 'block');
            $('#type14').css('display', 'block');
            $('#type15').css('display', 'block');
            $('#type16').css('display', 'none');
        }
        if (params.change[0]['value'] == '食物') {
            $('#type2 .shiwu-input').attr('lay-verify','required');
            $('#type1 .fangkuai-input').removeAttr('lay-verify');
            $('#type3 .gongju-input').removeAttr('lay-verify');
            $('#type4 .mozhou-input').removeAttr('lay-verify');
            $('#type5 .zhuangtai-input').removeAttr('lay-verify');
            $('#type6 .shengwu-input').removeAttr('lay-verify');
            $('#type1').css('display', 'none');
            $('#type2').css('display', 'block');
            $('#type3').css('display', 'none');
            $('#type4').css('display', 'none');
            $('#type5').css('display', 'none');
            $('#type6').css('display', 'none');
            $('#type7').css('display', 'none');
            $('#type8').css('display', 'none');
            $('#type9').css('display', 'none');
            $('#type10').css('display', 'none');
            $('#type11').css('display', 'none');
            $('#type12').css('display', 'none');
            $('#type13').css('display', 'none');
            $('#type14').css('display', 'block');
            $('#type15').css('display', 'block');
            $('#type16').css('display', 'none');
        }
        if (params.change[0]['value'] == '工具') {
            $('#type1 .fangkuai-input').removeAttr('lay-verify');
            $('#type2 .shiwu-input').removeAttr('lay-verify');
            $('#type3 .gongju-input').attr('lay-verify','required');
            $('#type4 .mozhou-input').removeAttr('lay-verify');
            $('#type5 .zhuangtai-input').removeAttr('lay-verify');
            $('#type6 .shengwu-input').removeAttr('lay-verify');
            $('#type1').css('display', 'none');
            $('#type2').css('display', 'none');
            $('#type3').css('display', 'block');
            $('#type4').css('display', 'none');
            $('#type5').css('display', 'none');
            $('#type6').css('display', 'none');
            $('#type7').css('display', 'none');
            $('#type8').css('display', 'none');
            $('#type9').css('display', 'none');
            $('#type10').css('display', 'none');
            $('#type11').css('display', 'none');
            $('#type12').css('display', 'none');
            $('#type13').css('display', 'none');
            $('#type14').css('display', 'block');
            $('#type15').css('display', 'block');
            $('#type16').css('display', 'none');
        }
        if (params.change[0]['value'] == '魔咒') {
            $('#type1 .fangkuai-input').removeAttr('lay-verify');
            $('#type2 .shiwu-input').removeAttr('lay-verify');
            $('#type3 .gongju-input').removeAttr('lay-verify');
            $('#type4 .mozhou-input').attr('lay-verify','required');
            $('#type5 .zhuangtai-input').removeAttr('lay-verify');
            $('#type6 .shengwu-input').removeAttr('lay-verify');
            $('#type1').css('display', 'none');
            $('#type2').css('display', 'none');
            $('#type3').css('display', 'none');
            $('#type4').css('display', 'block');
            $('#type5').css('display', 'none');
            $('#type6').css('display', 'none');
            $('#type7').css('display', 'block');
            $('#type8').css('display', 'none');
            $('#type9').css('display', 'none');
            $('#type10').css('display', 'none');
            $('#type11').css('display', 'none');
            $('#type12').css('display', 'none');
            $('#type13').css('display', 'none');
            $('#type14').css('display', 'none');
            $('#type15').css('display', 'none');
            $('#type16').css('display', 'none');
        }
        if (params.change[0]['value'] == '状态') {
            $('#type1 .fangkuai-input').removeAttr('lay-verify');
            $('#type2 .shiwu-input').removeAttr('lay-verify');
            $('#type3 .gongju-input').removeAttr('lay-verify');
            $('#type4 .mozhou-input').removeAttr('lay-verify');
            $('#type5 .zhuangtai-input').attr('lay-verify','required');
            $('#type6 .shengwu-input').removeAttr('lay-verify');
            $('#type1').css('display', 'none');
            $('#type2').css('display', 'none');
            $('#type3').css('display', 'none');
            $('#type4').css('display', 'none');
            $('#type5').css('display', 'block');
            $('#type6').css('display', 'none');
            $('#type7').css('display', 'block');
            $('#type8').css('display', 'none');
            $('#type9').css('display', 'none');
            $('#type10').css('display', 'none');
            $('#type11').css('display', 'none');
            $('#type12').css('display', 'none');
            $('#type13').css('display', 'none');
            $('#type14').css('display', 'none');
            $('#type15').css('display', 'none');
            $('#type16').css('display', 'block');
        }
        if (params.change[0]['value'] == '生物') {
            $('#type1 .fangkuai-input').removeAttr('lay-verify');
            $('#type2 .shiwu-input').removeAttr('lay-verify');
            $('#type3 .gongju-input').removeAttr('lay-verify');
            $('#type4 .mozhou-input').removeAttr('lay-verify');
            $('#type5 .zhuangtai-input').removeAttr('lay-verify');
            $('#type6 .shengwu-input').attr('lay-verify','required');
            $('#type1').css('display', 'none');
            $('#type2').css('display', 'none');
            $('#type3').css('display', 'none');
            $('#type4').css('display', 'none');
            $('#type5').css('display', 'none');
            $('#type6').css('display', 'block');
            $('#type7').css('display', 'none');
            $('#type8').css('display', 'block');
            $('#type9').css('display', 'block');
            $('#type10').css('display', 'block');
            $('#type11').css('display', 'block');
            $('#type12').css('display', 'block');
            $('#type13').css('display', 'none');
            $('#type14').css('display', 'none');
            $('#type15').css('display', 'block');
            $('#type16').css('display', 'none');
        }
    }
</script>
</body>
</html>